package com.starry.push.netty.task;

import com.starry.push.netty.service.HandleImpl;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author WuChao
 * @version 1.0
 * @date 2020/11/9 16:32
 */
@Configuration      //1.主要用于标记配置类，兼备Component的效果。
@EnableScheduling   // 2.开启定时任务
@Slf4j
@AllArgsConstructor
public class HandleTask {


    @Autowired
    private HandleImpl handle;



    @Scheduled(fixedRate = 1000*60*2 )
    public void moveContent() {
        log.info("清除系统未认证的链接");
        handle.moveContents();
    }




}
